package cn.chinawyny.boot.bootdemo.configurations;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        // addResourceHandler： path patrerns   ; addResourceLocations：资源路径地址，一般为classtpath开始
//        registry.addResourceHandler("/lytest/**").addResourceLocations("classpath:/lytest/");
    }

    @Override
    public void addCorsMappings(CorsRegistry registry) {
//        registry.addMapping("/**");
    }
}
